/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.struts2.json.annotations.JSON;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "t_mainmenus")
//@NamedQueries({@NamedQuery(name = "TMainmenus.findAll", query = "SELECT t FROM TMainmenus t"), @NamedQuery(name = "TMainmenus.findByMainmenuId", query = "SELECT t FROM TMainmenus t WHERE t.mainmenuId = :mainmenuId"), @NamedQuery(name = "TMainmenus.findByMainmenuName", query = "SELECT t FROM TMainmenus t WHERE t.mainmenuName = :mainmenuName"), @NamedQuery(name = "TMainmenus.findByIsUse", query = "SELECT t FROM TMainmenus t WHERE t.isUse = :isUse"), @NamedQuery(name = "TMainmenus.findByIsOpen", query = "SELECT t FROM TMainmenus t WHERE t.isOpen = :isOpen"), @NamedQuery(name = "TMainmenus.findByCtrlDate", query = "SELECT t FROM TMainmenus t WHERE t.ctrlDate = :ctrlDate"), @NamedQuery(name = "TMainmenus.findByAction", query = "SELECT t FROM TMainmenus t WHERE t.action = :action"), @NamedQuery(name = "TMainmenus.findByOrderid", query = "SELECT t FROM TMainmenus t WHERE t.orderid = :orderid")})
public class TMainmenus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "mainmenu_id")
    private String mainmenuId;
    @Basic(optional = false)
    @Column(name = "mainmenu_name")
    private String mainmenuName;
    @Column(name = "is_use")
    private String isUse;
    @Column(name = "is_open")
    private String isOpen;
    @Column(name = "ctrl_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ctrlDate;
    @Column(name = "action")
    private String action;
    @Column(name = "orderid")
    private Short orderid;

    public TMainmenus() {
    }

    public TMainmenus(String mainmenuId) {
        this.mainmenuId = mainmenuId;
    }

    public TMainmenus(String mainmenuId, String mainmenuName) {
        this.mainmenuId = mainmenuId;
        this.mainmenuName = mainmenuName;
    }

    public String getMainmenuId() {
        return mainmenuId;
    }

    public void setMainmenuId(String mainmenuId) {
        this.mainmenuId = mainmenuId;
    }

    public String getMainmenuName() {
        return mainmenuName;
    }

    public void setMainmenuName(String mainmenuName) {
        this.mainmenuName = mainmenuName;
    }

    public String getIsUse() {
        return isUse;
    }

    public void setIsUse(String isUse) {
        this.isUse = isUse;
    }

    public String getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(String isOpen) {
        this.isOpen = isOpen;
    }

	@JSON(format="yyyy-MM-dd HH:mm:ss")
    public Date getCtrlDate() {
        return ctrlDate;
    }

    public void setCtrlDate(Date ctrlDate) {
        this.ctrlDate = ctrlDate;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public Short getOrderid() {
        return orderid;
    }

    public void setOrderid(Short orderid) {
        this.orderid = orderid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mainmenuId != null ? mainmenuId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TMainmenus)) {
            return false;
        }
        TMainmenus other = (TMainmenus) object;
        if ((this.mainmenuId == null && other.mainmenuId != null) || (this.mainmenuId != null && !this.mainmenuId.equals(other.mainmenuId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.TMainmenus[mainmenuId=" + mainmenuId + "]";
    }

}
